package com.swg.config;

import com.swg.bean.Cat;
import com.swg.bean.Dog;
import com.swg.bean.Pig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan("com.swg.bean")
public class MainConfigOfLifeCycle {

    @Bean(initMethod = "init",destroyMethod = "destory")
    public Dog dog(){
        return new Dog();
    }


    @Bean
    public Cat cat(){
        return new Cat();
    }

    @Bean
    public Pig pig(){
        return new Pig();
    }
}
